<!DOCTYPE html>  
<html lang="en">  
<head>  
    <meta charset="UTF-8">  
    <meta name="viewport" content="width=device-width, initial-scale=1.0">  
    <title>新页面</title>  
    <style>  
        /* CSS样式 */  
        body {  
            font-family: Arial, sans-serif;  
            padding: 20px;  
        }  
        .error-message {  
            color: red;  
        }  
    </style>  
</head> 
<body>  
    <input type="text" id="inputBox" placeholder="输入内容显示照片">  
    <button onclick="togglePhoto()">显示/隐藏照片</button>  
    <img id="photo" src="C:\Users\86173\Pictures\联想锁屏壁纸\微信图片_20240227154321.jpg" alt="照片" class="hidden">  
  
    <script>  
        function togglePhoto() {  
            var inputBox = document.getElementById('inputBox');  
            var photo = document.getElementById('photo');  
              
            if (inputBox.value.trim() !== '') {  
                photo.classList.remove('hidden');  
            } else {  
                photo.classList.add('hidden');  
            }  
        }  
 
    </script>  
</body>  
</html>